<template>
<section>
     <el-table
      v-loading="listLoading"
    border
    ref="multipleTable"
    :data="tableData"
    tooltip-effect="dark"
    style="width: 100%"
    @selection-change="handleSelectionChange">
    <el-table-column
      type="selection">
    </el-table-column> 
    <el-table-column
      prop="assetNum"
      label="领用编号"
      width="120">
    </el-table-column>
    <el-table-column
      prop="assetNum"
      label="领用资产名称(多个以逗号分开)"
      width="120">
    </el-table-column>
    <el-table-column
      prop="assetNum"
      label="领用人"
      width="120">
    </el-table-column>
    <el-table-column
      prop="assetNum"
      label="领用后使用公司"
      width="120">
    </el-table-column>
     <el-table-column
      prop="assetNum"
      label="领用后使用部门"
      width="120">
    </el-table-column>
     <el-table-column
      prop="assetNum"
      label="领用后使用员工"
      width="120">
    </el-table-column>
     <el-table-column
      prop="assetNum"
      label="领用后存放区域"
      width="120">
    </el-table-column>
    <el-table-column
      prop="crateTime"
      label="创建时间"
      show-overflow-tooltip>
    </el-table-column>
  </el-table>
   <el-col :span="24" class="toolbar">
        <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[20, 50, 100, 200]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalNum">
        </el-pagination>
    </el-col>
</section>
   
</template>

<script>
import api from "@/service/api";
import http from "@/service/http";
export default {
  data() {
    return {
	    listLoading:false,
        pageSize:20,
        totalNum:0,
      currentPage: 1,
      tableData:[]
    };
  },
  methods: {
    handleSelectionChange(val) {
      console.log(`val`);
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
        this.pageSize = val;
        this.getInboundList();
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val;
      this.getInboundList();
    },
    getInboundList(){
        this.listLoading=true;
        var search = {pageNum:this.currentPage,pageSize:this.pageSize}
         http.post(api.sysApi.getInboundList, search).then(data => {
           if(!data.success){
				return;
			}
            this.tableData = data.data;
            this.totalNum = data.totalNum;
            this.listLoading=false;
        });
    }
  },
  mounted(){
       this.getInboundList()
  }
};
</script>

<style>
.el-pagination {
  float: right;
}
</style>
